import axios from './request'
import conf from './apiConf'
import { Encrypt} from '../plugins/crypto'


// 例子
export const getnewslist = params => {
  return axios.get(conf.getnewslist, params)
}
export const Login = opt => {
  return axios.post(conf.Login, opt)
  //加密参数
  // axios.post(conf.encrypt, opt).then((res) => {
  //   if (res.status == 200)return axios.post(conf.Login, res.data)
  // }, (err) => {
  //   console.error('encrypt request error:',err);
  // })
  
}
export const Register = opt => {
  return axios.post(conf.Register, opt)
}
export const getCode = opt => {
  return axios.post(conf.getPhoneCode, opt)
}

export const apdataUser = opt => {
  return axios.post(conf.UpdateUserInfo, opt)
}
export const uploadImg = (opt,config) => {
  return axios.post(conf.uploadFile, opt, config)
}
